﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Exam.Core.DBUtility;

namespace Exam.Core.SQLDAL
{
    public class QuestionDifficulty {
        //返回所有
        public List<Exam.Core.Model.QuestionDifficulty> getQuestionDifficultyList() {
            string path = FilePath.QuestionDifficultyXmlPath.Trim();
            XmlDocument doc = XmlHelper.GetXmlDocument(path);
            List<Exam.Core.Model.QuestionDifficulty> list = new List<Exam.Core.Model.QuestionDifficulty>();
            XmlNodeList nodeList = doc.GetElementsByTagName("questiondifficulty");
            foreach (XmlNode node in nodeList) {
                Exam.Core.Model.QuestionDifficulty obj = new Exam.Core.Model.QuestionDifficulty();
                obj.QuestionDifficultyId = node.Attributes["id"].Value;
                obj.QuestionDifficultyTitle = node.Attributes["title"].Value;
                list.Add(obj);
            }
            return list;

        }
    }
}
